package org.qhhc.hashcodestudy;

public class FixedHashStudent {
    private String name;
    private int age;

    public FixedHashStudent(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public int hashCode() {
        return 0; // 固定返回0
    }

    public static void main(String[] args) {
        FixedHashStudent s1 = new FixedHashStudent("Alice", 20);
        FixedHashStudent s2 = new FixedHashStudent("Bob", 25);
        System.out.println(s1.hashCode()); // 0
        System.out.println(s2.hashCode()); // 0
    }
}

